class Solution:
    def singleNumber(self, nums: list) -> list:
        mid_set = set()
        for num in nums:
            if num in mid_set:
                mid_set.remove(num)
            else:
                mid_set.add(num)
        return list(mid_set)


a = Solution()
print(a.singleNumber([1, 2, 1, 3, 2, 5]))
